ScMobileApp.CasaController = Ember.Controller.extend({
	pageInit: function(view) {
		this.view = view;
	    this.eventBind();
		this.dataBind();
	},
	eventBind: function(){
		this.view.$("#btn_save").click($.proxy(function(){
			sessionStorage.setItem("join-product-nm",this.view.$("#join_product_nm").val());
			sessionStorage.setItem("join-amount",this.view.$("#join_amount").val());
			
			this.transitionToRouteAnimated('finish', {main: 'slideLeft'});
	
			return false;

		}, this));
	},
	dataBind: function(){
		/*
		var msg = "";

		msg += "[=== 고객기본정보 ==]";
		msg += "\n\n";
		msg += "이름(한글):" + sessionStorage.getItem("cust_kor_nm");
		msg += "\n\n";
		msg += "이름(영문):" + sessionStorage.getItem("cust_eng_nm");
		msg += "\n\n";

		var casaList = sessionStorage.getItem("casa");
		casaList = JSON.parse(casaList);
		
		msg += "CASA LENGTH : " + casaList.length;
		msg += "\n\n";
		
		for(var i=0; i < casaList.length; i++){
			msg += casaList[i].casa_id;
			msg += casaList[i].casa_nm;
			msg += "\n\n";
		}

		this.view.$("#cust_kor_nm").val(sessionStorage.getItem("cust_kor_nm"));
		this.view.$("#cust_eng_nm").val(sessionStorage.getItem("cust_eng_nm"));

		var casaList = sessionStorage.getItem("casa");
		casaList = JSON.parse(casaList);
		
		var html = "";
		html += "<ul style='clear:both;'>";
			html += "<li style='float:left;width:120px;line-height:30px;font-weight:bold;'>상품아이디<li>";
			html += "<li style='float:left;width:250px;line-height:30px;font-weight:bold;'>상품명<li>";
		html += "</ul>";
		

		
		for(var i=0; i < casaList.length; i++){
			html += "<ul  style='clear:both;'>";
				html += "<li style='float:left;width:120px;line-height:24px;'>"+casaList[i].casa_id+"<li>";
				html += "<li style='float:left;width:250px;line-height:24px;'>"+casaList[i].casa_nm+"<li>";
			html += "</ul>";
		}

		this.view.$(".casa-info").html(html);
		*/
	}
});
